/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSky.factory;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import ru.jSky.factory.BridgeFactory;
import ru.jSky.interfaces.JSkyLeveledEntry;
import ru.jSky.interfaces.Major;
import skyproc.LeveledEntry;

/**
 *
 * @author Rakev
 */
public class LeveledEntryFactory {
    
    private BridgeFactory bridgeFactory = new BridgeFactory();
    
    public List<JSkyLeveledEntry> create(Collection<Major> items, int level, int count){
        List<JSkyLeveledEntry> leveledEntrys = new ArrayList<>(items.size());
        for (Major item : items){
            JSkyLeveledEntry entry = create(item, level, count);
            leveledEntrys.add(entry);
        }
        return leveledEntrys;
    }
    
    public List<JSkyLeveledEntry> create(int level, int count, Major... items){
        List<JSkyLeveledEntry> leveledEntrys = new ArrayList<>(items.length);
        for (Major item : items){
            JSkyLeveledEntry entry = create(item, level, count);
            leveledEntrys.add(entry);
        }
        return leveledEntrys;
    }

    private JSkyLeveledEntry create(Major item, int level, int count) {
        LeveledEntry rawEntry = new LeveledEntry(item.getForm(), level, count);
        return bridgeFactory.createBridge(rawEntry);
    }
    
}
